]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
widget: Only include visible actors in focus chain
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 7 Feb 2017 19:22:18 +0000 (20:22 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 8 Feb 2017 13:50:36 +0000 (14:50 +0100)
It isn't useful to move the keyboard focus to a hidden actor, so
only include visible actors in the focus chain - this is in fact
the documented behavior of st_widget_get_focus_chain(), so having
the default implementation return all children has always been
unexpected.

https://bugzilla.gnome.org/show_bug.cgi?id=778158

src/st/st-widget.c

index e20c845a0e05c181e0c8bbeaf3e89cabe2517510..002249d256362529a80fd39d7af609fbb2702b86 100644 (file)
@@ -821,7 +821,19 @@ st_widget_get_paint_volume (ClutterActor *self,
 static GList *
 st_widget_real_get_focus_chain (StWidget *widget)
 {
-  return clutter_actor_get_children (CLUTTER_ACTOR (widget));
+  GList *children, *l, *visible = NULL;
+
+  children = clutter_actor_get_children (CLUTTER_ACTOR (widget));
+
+  for (l = children; l; l = l->next)
+    {
+      if (clutter_actor_is_visible (CLUTTER_ACTOR (l->data)))
+        visible = g_list_prepend (visible, l->data);
+    }
+
+  g_list_free (children);
+
+  return g_list_reverse (visible);
 }